/*******************************************************************************
 * Copyright (c) 2019, 2025 Lablicate GmbH.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 * Philip Wenig - initial API and implementation
 *******************************************************************************/
package org.eclipse.chemclipse.model.ranges;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

public class TimeRange_7_Test {

	private TimeRange timeRange = new TimeRange("Test", 500, 350, 200);

	@Test
	public void test0() {

		assertEquals("Test", timeRange.getIdentifier());
	}

	@Test
	public void test1() {

		assertEquals(200, timeRange.getStart());
	}

	@Test
	public void test2() {

		assertEquals(350, timeRange.getMaximum());
	}

	@Test
	public void test3() {

		assertEquals(500, timeRange.getStop());
	}

	@Test
	public void test4() {

		timeRange.updateStart(501);
		assertEquals(200, timeRange.getStart());
		assertEquals(350, timeRange.getMaximum());
		assertEquals(500, timeRange.getStop());
	}

	@Test
	public void test5() {

		timeRange.updateStop(199);
		assertEquals(200, timeRange.getStart());
		assertEquals(350, timeRange.getMaximum());
		assertEquals(500, timeRange.getStop());
	}

	@Test
	public void test6() {

		timeRange.updateStart(250);
		assertEquals(250, timeRange.getStart());
		assertEquals(350, timeRange.getMaximum());
		assertEquals(500, timeRange.getStop());

		timeRange.updateMaximum();
		assertEquals(375, timeRange.getMaximum());
	}

	@Test
	public void test7() {

		timeRange.updateStop(550);
		assertEquals(200, timeRange.getStart());
		assertEquals(350, timeRange.getMaximum());
		assertEquals(550, timeRange.getStop());

		timeRange.updateMaximum();
		assertEquals(375, timeRange.getMaximum());
	}

	@Test
	public void test8() {

		timeRange.updateStart(250);
		timeRange.updateStop(550);
		assertEquals(250, timeRange.getStart());
		assertEquals(350, timeRange.getMaximum());
		assertEquals(550, timeRange.getStop());

		timeRange.updateMaximum();
		assertEquals(400, timeRange.getMaximum());
	}
}
